import {
  Entity,
  Column,
  PrimaryGeneratedColumn,
  ManyToOne,
  JoinColumn,
  ManyToMany,
  JoinTable,
  OneToMany,
} from 'typeorm';
import { LessonsSort } from '../../lessons-sort/entities/lessons-sort.entity';

/**
教室
*/
@Entity()
export class ClassRoom {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ comment: '教室名称', unique: true })
  class_room_name: string;

  @Column({ comment: '人数' })
  capacity: number;

  @OneToMany(() => LessonsSort, (lessonsSort) => lessonsSort.classRoom, {
    onDelete: 'SET NULL',
  })
  lessonsSorts: LessonsSort[];
}
